package mycollections;

import java.util.ArrayList;
import java.util.Collections;

public class demo1 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        //把这些元素添加在list集合里
        Collections.addAll(list, "abc", "bba", "ccd", "gge");
        System.out.println(list);
        //随机打乱顺序
        Collections.shuffle(list);
        System.out.println(list);
        //将集合中元素按照默认规则排序。
        Collections.sort(list);
        System.out.println(list);

    }
}
